import { createApp } from "vue";
import App from "./App.vue";
// 引入elementplush
import ElementPlus from "element-plus";
//引入样式
import "element-plus/dist/index.css";
import "./styles/index.scss";

//引入语言
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import * as echarts from "echarts";

// 将elementplus图标注册为全局组件
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
// 切换暗黑模式
import "element-plus/theme-chalk/dark/css-vars.css";
// 引入路由
import router from "./router";

// 引入pinnia
import pinia from "./store";

// import DataV, { setClassNamePrefix } from '@dataview/datav-vue3';

import dataV from "@jiaminghi/data-view";
// import dataV from '@jiaminghi/datav-vue3'
// 引入antd design Vue UI
// import Antd from 'ant-design-vue';
// import 'ant-design-vue/dist/antd.css';

//获取应用实例对象
const app = createApp(App);
app.config.productionTip = false;
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 全局挂载echarts
app.config.globalProperties.$echarts = echarts;
// document.addEventListener("keydown", function(event) {
//   if (event.key === "F12") {
//     console.log("F12 key pressed!");
//     // 注意：在这里使用 debugger 语句会导致浏览器在开发者工具打开时暂停执行
//     // debugger; // 谨慎使用
//   }
// });
//配置国际化
app.use(ElementPlus, {
  locale: zhCn,
});
app.use(pinia);
// 注册路由模板
app.use(router);
// app.use(Antd);
// 挂载datav  如果有报错，更改node_modules/@dataview/datav-vue3 package.json中的  "module": "./es/index.mjs",
// app.use(DataV, { classNamePrefix: 'dv-' });
app.use(dataV);

//讲应用挂载到挂载点
app.mount("#app");
